<include file="public@header" />
<script type="text/html" id="photos-item-tpl">
    <li id="saved-image{id}">
        <input id="photo-{id}" type="hidden" name="photo_urls[]" value="{filepath}">
        <input class="form-control" id="photo-{id}-name" type="text" name="photo_names[]" value="{name}"
               style="width: 200px;" title="图片名称">
        <img id="photo-{id}-preview" src="{url}" style="height:36px;width: 36px;"
             onclick="imagePreviewDialog(this.src);">
        <a href="javascript:uploadOneImage('图片上传','#photo-{id}');">替换</a>
        <a href="javascript:(function(){$('#saved-image{id}').remove();})();">移除</a>
    </li>

    
</script>
</head>
<body>
	<div class="wrap">
		<ul class="nav nav-tabs">
			<li><a href="{:url('AdminBusiness/index')}">主营业务列表</a></li>
            <li><a href="{:url('AdminBusiness/add')}">新增主营业务</a></li>
			<li class="active"><a>修改主营业务</a></li>
            
		</ul>
        <form method="post" class="form-horizontal is-ajax-form margin-top-20" action="{:url('AdminBusiness/editPost')}">
			<div class="form-group">
				<label for="input-user_login" class="col-sm-2 control-label"><span class="form-required">*</span>名称</label>
				<div class="col-md-6 col-sm-10">
					<input type="text" class="form-control" id="input-name" name="post[name]" value="{$service.name}" required>
				</div>
            </div>
            <div class="form-group">
				<label for="input-user_login" class="col-sm-2 control-label"><span class="form-required">*</span>缩略图</label>
				<div class="col-md-6 col-sm-10">
					<ul id="photos" class="pic-list list-unstyled form-inline">
                        <notempty name="$service.thumbnail">
                            <foreach name="$service.thumbnail" item="vo" key="key">
                                <php>$img_url=cmf_get_image_preview_url($vo);</php>
                                <li id="saved-image{$key}">
                                    <input id="cert-{$key}" type="hidden" name="cert_urls[]"
                                           value="{$vo}">
                                    <input class="form-control" id="cert-{$key}-name" type="text"
                                           name="cert_names[]"
                                           value="{$vo.name|default=''}" style="width: 200px;" title="图片名称">
                                    <img id="cert-{$key}-preview"
                                         src="{:cmf_get_image_preview_url($vo)}"
                                         style="height:36px;width: 36px;"
                                         onclick="parent.imagePreviewDialog(this.src);">
                                    <a href="javascript:uploadOneImage('图片上传','#cert-{$key}');">替换</a>
                                    <a href="javascript:(function(){$('#saved-image{$key}').remove();})();">移除</a>
                                </li>
                            </foreach>
                        </notempty>
                    </ul>
                    <a href="javascript:uploadMultiImage('图片上传','#photos','photos-item-tpl');"
                               class="btn btn-default-primary btn-sm layui-btn">上传缩略图</a>
				</div>
            </div>
            <div class="form-group">
				<label for="input-user_login" class="col-sm-2 control-label"><span class="form-required">*</span>排序</label>
				<div class="col-md-6 col-sm-10">
					<input type="text" class="form-control" id="input-list_order" value="{$service.list_order}"  name="post[list_order]" required>
				</div>
            </div>
            
			<div class="form-group">
				<div class="col-sm-offset-2 col-sm-10">
                    <input type="hidden" class="form-control" id="input-list_order" value="{$service.id}"  name="post[id]">
					<button type="submit" class="btn btn-primary js-ajax-submit">{:lang('SAVE')}</button>
				</div>
			</div>
		</form>
	</div>
    <script src="__STATIC__/js/admin.js"></script>
       
</body>
</html>